package com.iot.show.utils;

import android.content.Context;
import android.widget.Toast;


import es.dmoral.toasty.Toasty;

import static com.iot.show.MyApplication.getAppContext;


public class T {

    private static Toast toast;

    public static void showToast(String content) {
        toast.setText(content);
        toast.show();
    }

    public static void success(Context context, String content) {
        Toasty.success(context, content, Toast.LENGTH_SHORT).show();
    }

    public static void success(String content) {
        Toasty.success(getAppContext(), content, Toast.LENGTH_SHORT).show();
    }

    public static void error(Context context, String content) {
        Toasty.error(context, content, Toast.LENGTH_SHORT).show();
    }

    public static void error(String content) {
        Toasty.error(getAppContext(), content, Toast.LENGTH_SHORT).show();
    }

    public static void info(Context context, String content) {
        Toasty.info(context, content, Toast.LENGTH_SHORT).show();
    }

    public static void info(String content) {
        Toasty.info(getAppContext(), content, Toast.LENGTH_SHORT).show();
    }

    public static void waring(Context context, String content) {
        Toasty.warning(context, content, Toast.LENGTH_SHORT).show();
    }

    public static void waring(String content) {
        Toasty.warning(getAppContext(), content, Toast.LENGTH_SHORT).show();
    }

    public static void normal(Context context, String content) {
        Toasty.normal(context, content, Toast.LENGTH_SHORT).show();
    }

    public static void normal(String content) {
        Toasty.normal(getAppContext(), content, Toast.LENGTH_SHORT).show();
    }

    public static void init(Context context) {
        toast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
    }
}
